package net.zjitc.controller;

import net.zjitc.domain.User;
import net.zjitc.service.Impl.ServiceImpl;
import net.zjitc.service.Service;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

/**
 * Created by guo on 2017/11/11.
 */
@WebServlet(name = "UserServlet",urlPatterns = "/userServlet")
public class UserServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        Service service=new ServiceImpl();
        List<User> list=service.findAll();
        request.setAttribute("user",list);
        request.getRequestDispatcher("admin/user/list.jsp").forward(request,response);
    }
}
